<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
</head>
<body>
  <div id="app">
    <button @click="minus">-</button>
    <span>{{n}}</span>
    <button @click="add">+</button>
  </div>
  <script>
      new Vue({
          el: "#app",
          data: {
              n:0
          },
          methods:{
              add(){
                  this.n++;
              },
              minus(){
                  if(this.n>0){
                      this.n--;
                  }
              }
          }
      })
  </script>
</body>
</html>